// 引入所使用到 的js
import { debounce } from "@/common/utils.js";
import bus from "utils/homeImgBus/bus";
export const itemListenerMixin = {
  data() {
    return {
      itemImgListener: null,
    }
  },
  mounted() {
    const refresh = debounce(this.$refs.scroll.refresh, 500);
    this.itemImgListener = function () {
      // that.$refs.scroll.refresh();
      refresh();
    }
    bus.$on("itemImgLoad", this.itemImgListener);
    // console.log('我是混入的内容');
  }
}

import BackTop from "components/content/backTop/BackTop";
export const backTopMixin = {
  components: {
    BackTop
  },
  data() {
    return {
      backTopGlog: false,
    }
  },
  methods: {
    backTop() {
      this.$refs.scroll.scrollTo(0, 0, 500);
    },
  }
}

import { POP, SELL, NEW } from "@/common/const";
export const tabControlMixin = {
  data: function () {
    return {
      currentType: POP
    }
  },
  methods: {
    tabClick(index) {
      switch (index) {
        case 0:
          this.currentType = POP
          break
        case 1:
          this.currentType = NEW
          break
        case 2:
          this.currentType = SELL
          break
        default:
          this.currentType = POP;
          break;
      }
      // console.log(this.currentType);
    }
  }
}
